package com.ybwh.spi;

import com.ybwh.springboot2.common.conf.Knife4jConfiguration;
import org.springframework.beans.factory.InitializingBean;
import org.springframework.boot.autoconfigure.AutoConfigureAfter;
import org.springframework.boot.autoconfigure.jdbc.DataSourceAutoConfiguration;
import org.springframework.context.annotation.Configuration;

/**
 * <p>
 *  配置在spring.factories里的bean直接会被加载，无论加不加spring注解
 * </p>
 *
 * @author fanbeibei
 * @version 1.0.0
 * @date 2023/3/2 17:02
 */
public class MySpiConfig implements InitializingBean {
    Knife4jConfiguration knife4jConfiguration;

    /**
     * 有构造器默认构造器注入
     *
     * @param knife4jConfiguration
     */
    public MySpiConfig(Knife4jConfiguration knife4jConfiguration) {
        this.knife4jConfiguration = knife4jConfiguration;
    }

    @Override
    public void afterPropertiesSet() throws Exception {
        System.out.println("--------------------MySpiConfig-----------------------------");
    }
}
